/**
 * @ClassName Car
 * @Description 汽车Entity
 * @Author 高达磊
 * @Date 2022/1/13-11:49
 * @Version 1.0
 */
public class Car implements Cloneable {
    /**
     * 品牌名称
     */
    private String brandName;

    /**
     * 颜色
     */
    private String color;

    public Car() {
    }

    public Car(String brandName) {
        this.brandName = brandName;
    }

    public Car(String brandName, String color) {
        this.brandName = brandName;
        this.color = color;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "品牌：".concat(this.brandName).concat("，颜色：").concat(this.color);
    }

    /**
     * 重写父类clone方法
     * 如果属性是引用数据类型，需要调用该属性的clone方法进行深拷贝。
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    protected Car clone() throws CloneNotSupportedException {
        return (Car) super.clone();
    }
}
